<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-1-8
 * Time: 下午2:16
 */

namespace common\components\loan;


use common\models\LoanApply;
use yii\base\Component;
use yii\base\ErrorException;

abstract class Loan extends Component
{
    /**
     * @var LoanApply $loan_apply
     */
    public $loan_apply;

    public static function checkHasLoanApplyErrorException($order_id)
    {
        if (LoanApply::findOne(['order_id'=>$order_id])){
            throw new ErrorException("已经存在借款申请订单号[{$order_id}]");
        }
    }
}